package com.dime.physical.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.uuid.IdUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dime.physical.mapper.DimeBasepackageharmMapper;
import com.dime.physical.domain.DimeBasepackageharm;
import com.dime.physical.service.IDimeBasepackageharmService;

/**
 * 套餐危害Service业务层处理
 * 
 * @author Tiny
 * @date 2023-09-14
 */
@Service
public class DimeBasepackageharmServiceImpl implements IDimeBasepackageharmService 
{
    @Autowired
    private DimeBasepackageharmMapper dimeBasepackageharmMapper;

    /**
     * 查询套餐危害
     * 
     * @param id 套餐危害主键
     * @return 套餐危害
     */
    @Override
    public DimeBasepackageharm selectDimeBasepackageharmById(String id)
    {
        return dimeBasepackageharmMapper.selectDimeBasepackageharmById(id);
    }


    @Override
    public List<DimeBasepackageharm> selectDimeBasepackageharmByPackageId(String packageId)
    {
        return dimeBasepackageharmMapper.selectDimeBasepackageharmByPackageId(packageId);
    }



    /**
     * 查询套餐危害列表
     * 
     * @param dimeBasepackageharm 套餐危害
     * @return 套餐危害
     */
    @Override
    public List<DimeBasepackageharm> selectDimeBasepackageharmList(DimeBasepackageharm dimeBasepackageharm)
    {
        return dimeBasepackageharmMapper.selectDimeBasepackageharmList(dimeBasepackageharm);
    }

    /**
     * 新增套餐危害
     * 
     * @param dimeBasepackageharm 套餐危害
     * @return 结果
     */
    @Override
    public int insertDimeBasepackageharm(DimeBasepackageharm dimeBasepackageharm)
    {

        dimeBasepackageharm.setId(IdUtils.fastUUID());
        dimeBasepackageharm.setCreateBy(SecurityUtils.getUsername());
        dimeBasepackageharm.setCreateTime(DateUtils.getNowDate());
        return dimeBasepackageharmMapper.insertDimeBasepackageharm(dimeBasepackageharm);
    }

    /**
     * 修改套餐危害
     * 
     * @param dimeBasepackageharm 套餐危害
     * @return 结果
     */
    @Override
    public int updateDimeBasepackageharm(DimeBasepackageharm dimeBasepackageharm)
    {
        dimeBasepackageharm.setUpdateTime(DateUtils.getNowDate());
        dimeBasepackageharm.setUpdateBy(SecurityUtils.getUsername());
        return dimeBasepackageharmMapper.updateDimeBasepackageharm(dimeBasepackageharm);
    }

    /**
     * 批量删除套餐危害
     * 
     * @param ids 需要删除的套餐危害主键
     * @return 结果
     */
    @Override
    public int deleteDimeBasepackageharmByIds(String[] ids)
    {
        return dimeBasepackageharmMapper.deleteDimeBasepackageharmByIds(ids);
    }

    /**
     * 删除套餐危害信息
     * 
     * @param id 套餐危害主键
     * @return 结果
     */
    @Override
    public int deleteDimeBasepackageharmById(String id)
    {
        return dimeBasepackageharmMapper.deleteDimeBasepackageharmById(id);
    }
}
